package org.example.product.entity;

import java.io.Serializable;

import jakarta.validation.constraints.*;
import lombok.Data;
import org.example.core.valid.annontation.ListValue;
import org.example.core.valid.group.AddGroup;
import org.example.core.valid.group.UpdateGroup;
import org.hibernate.validator.constraints.URL;

/**
 * @author 小杰_cc
 * @version 1.0
 */
@Data
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@NotNull(message = "修改时必须指定id",groups = {UpdateGroup.class})
	@Null(message = "添加时不能指定id",groups = {AddGroup.class})
	private Long id;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名不能为空",groups = {UpdateGroup.class, AddGroup.class})
	private String name;
	/**
	 * 首字母
	 */
	@NotBlank(message = "检索首字母不能为空",groups = {UpdateGroup.class, AddGroup.class})
	@Pattern(regexp = "^[a-zA-Z]$",message = "首字母必须是一个大小写的字母",groups = {UpdateGroup.class, AddGroup.class})
	private String firstLetter;
	/**
	 * 品牌简介
	 */
	private String describe;
	/**
	 * 排序
	 */
	@NotNull(message = "排序字段不能为空",groups = {AddGroup.class, UpdateGroup.class})
	@Min(value = 0,message = "排序字段必须是一个大于等于0的数",groups = {UpdateGroup.class, AddGroup.class})
	private Integer sort;
	/**
	 * 是否显示(0-显示,1-不显示)
	 */
	@NotNull(message = "请确认是否要显示",groups = {AddGroup.class, UpdateGroup.class})
	@ListValue(value = {0,1},groups = {AddGroup.class, UpdateGroup.class})
	private Integer visible;
	/**
	 * 品牌logo地址
	 */
	@URL(message = "品牌图标必须是一个URL地址",groups = {AddGroup.class, UpdateGroup.class})
	private String logoUrl;
	/**
	 * 是否删除(0-未删除,1-删除)
	 */
	private Integer isDeleted;

}
